using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Prototype;

public partial class AddPayment : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        PaymentType[] paymentTypes = PaymentType.GetAllPaymentTypes();
        List<string> paymentTypeNames = new List<string>();
        foreach (PaymentType paymentType in paymentTypes)
        {
            paymentTypeNames.Add(paymentType.Name);
        }
        DropDownListCategory.DataSource = paymentTypeNames;
        DropDownListCategory.DataBind();
    }
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        Payment.InsertPayment(DropDownListCategory.SelectedValue, TextBoxReason.Text,
            DateTime.Now, decimal.Parse(TextBoxPrice.Text));
    }
}
